<extend name="public:template" />
<block name="title">文章列表</block>
<block name="style">
    <link rel="stylesheet" href="__STATIC__/layui/css/layui.css" type="text/css">
</block>
<block name="content">
    <div class="wrap-page">
        <div id="pageBookList" class="page-content">
            <Admintemplate file="Common/SubTabs"/>
            <div class="box">
                <div class="box-content">
                    <div class="wrap-table">
                        <div class="table-bar table-bar-head clearfix">
                            <div class="fl-l">
                                <div class="tools">
                                    <span class="tool-item"><a class="button button-blue" href="{:U('Backend/article/add')}">添加文章</a></span>
                                    <span class="tool-item"><a class="button button-red btn-delete-batch" href="javascript:;" data-url="{:U('Backend/article/delete')}">删除所选</a></span>
                                </div>
                            </div>
                            <div class="fl-r">
                                <div class="tools">
                                    <span class="tool-item"><button onclick="javascript:window.location.replace(window.location.href);" class="button button-default" type="button">刷新列表</button></span>
                                </div>
                            </div>
                        </div>

                        <div class="table-bar table-bar-head data-filter clearfix">
                        <form id="formFilterBook" action="{:U('Backend/article/index')}" class="form default-style clearfix" method="get">
                        <input type="hidden" name="m" value="Backend" />
                        <input type="hidden" name="c" value="article" />
                        <input type="hidden" name="a" value="index" />
                        <div class="tools">

                        <div class="filter-item">
                        <span class="tool-item tool-text">{:L('article_cateid')}：</span>
                        <span class="tool-item">
                        <select class="J_cate_select mr10" data-pid="0" data-uri="{:U('backend/article_cate/ajax_getchilds')}" data-selected="{$article.cate_path}">
                        </select>
                        <input type="hidden" name="cate_id" id="cate_id" value="{$cate_id}" />
                        </span>
                        </div>

                        <div class="filter-item">
                        <span class="tool-item tool-text">{:L('publish_time')}：</span>
                        <span class="tool-item"><input id="time_start" name="time_start" type="text" class="textfield Wdate" value="{$filter.createtime.start}" placeholder="开始时间" style="width:120px;" /></span>
                        <span class="tool-item tool-text">-</span>
                        <span class="tool-item"><input id="time_end" name="time_end" type="text" class="textfield Wdate" value="{$filter.createtime.end}" placeholder="结束时间" style="width:120px;" /></span>
                        </div>

                        <div class="filter-item">
                        <span class="tool-item tool-text">{:L('status')}：</span>
                        <span class="tool-item">
                        <select name="status">
                            <option value="null">-{:L('all')}-</option>
                            <option value="1" <if condition="$_GET['status'] eq '1'">selected="selected"</if>>已审核</option>
                            <option value="0" <if condition="$_GET['status'] eq '0'">selected="selected"</if>>未审核</option>
                        </select>
                        </span>
                        </div>

                        <div class="filter-item">
                        <span class="tool-item tool-text"><label for="keyword">{:L('keyword')}：</label></span>
                        <span class="tool-item"><input id="keyword" name="keyword" type="text" class="textfield" value="{$filter.isbn}" placeholder="关键字" style="width:120px;" /></span>
                        </div>

                        <div class="filter-item">
                        <span class="tool-item"><button type="submit" class="button button-blue">查询</button></span>
                        <span class="tool-item"><button id="btnClean" type="reset" class="button button-default">重置</button></span>
                        </div>
                        </div>

                        </form>
                        </div>
                            <table class="table default-style" cellpadding="0" cellspacing="0" width="100%">
                                <thead>
                                <tr>
                                    <th width="40"><div class="th-inner"><input type="checkbox" name="checkall" class="J_checkall"></div></th>
                                    <th width="40"><div class="th-inner">序号</div></th>
                                    <th width="40"><div class="th-inner">ID</div></th>
                                    <th><div class="th-inner al-c">{:L('article_title')}</div></th>
                                    <th><div class="th-inner al-c">{:L('article_cateid')}</div></th>
                                    <th><div class="th-inner al-c">{:L('author')}</div></th>
                                    <th><div class="th-inner al-c">{:L('publish_time')}</div></th>
                                    <th><div class="th-inner al-c">{:L('sort_order')}</div></th>
                                    <th><div class="th-inner al-c">{:L('status')}</div></th>
                                    <th width=100><div class="th-inner al-c">{:L('operations_manage')}</div></th>
                                </tr>
                                </thead>
                                <tbody>
                                <empty name="list">
                                    <tr class="empty"><td colspan="20"><div class="data-empty">暂无数据</div></td></tr>
                                </empty>
                                <volist name="list" id="val">
                                    <tr>
                                        <td align="center"><input type="checkbox" class="J_checkitem" value="{$val.id}"></td>
                                        <td align="center">{$key+1}</td>
                                        <td align="center">{$val.id}</td>
                                        <td align="left"><div class="th-inner al-l">{$val.title}<notempty name="val['thumb']"><span class="attachment_icon" file-type="image" file-rel="__ROOT__/upload{$val.thumb}"><img src="__STATIC__/admin/css/bgimg/image_s.gif" /></span></notempty></div></td>
                                        <td align="center">{$cate_list[$val['cate_id']]['cate_name']}</td>
                                        <td align="center">{$val['source']}</td>
                                        <td align="center">{$val.addtime|date='Y-m-d H:i:s',###}</td>
                                        <td align="center"><span data-tdtype="edit" data-field="ordid" data-id="{$val.id}" class="tdedit">{$val.ordid}</span></td>
                                        <td align="center">
                                            <if condition="$val.status eq 1">
                                                <i class="layui-icon layui-icon-ok">&#xe605;</i>
                                            </if>
                                            <if condition="$val.status eq 0">
                                                <i class="layui-icon layui-icon-no">&#x1006;</i>
                                            </if></td>
                                        <td align="center">
                                            <a href="{:u('article/edit', array('id'=>$val['id'], 'menuid'=>$menuid))}"><i class="layui-icon layui-icon-edit">&#xe642;</i>{:L('edit')}</a> |
                                            <a href="javascript:void(0);" class="layer_confirm" data-acttype="ajax" data-url="{:u('article/delete', array('id'=>$val['id']))}" data-msg="{:sprintf(L('confirm_delete_one'),$val['title'])}"><i class="layui-icon layui-icon-del">&#xe640;</i>{:L('delete')}</a>
                                        </td>
                                    </tr>
                                </volist>
                                </tbody>
                            </table>
                        <notempty name="page">
                            <div class="table-bar table-bar-foot clearfix page-container">
                                <div class="fl-r">
                                    <div class="tools">
                                    <span class="tool-item tool-text">
                                        <span class="pagging">{$page}</span>
                                        <span></span>
                                    </span>
                                    </div>
                                </div>
                            </div>
                        </notempty>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <input type="hidden" id="json_cate_list" value='{$json_cate_list}'>

</block>
<block name="script">
    <script src="__STATIC__/admin/js/common.js"></script>
    <script src="__STATIC__/laydate/laydate.js" type="text/javascript"></script>
    <script src="__STATIC__/layui/layui.js" type="text/javascript"></script>
    <script>
        laydate.skin('molv');
        laydate({
            elem: '#time_start',
        });
        laydate({
            elem: '#time_end',
        });
        $(function() {
            var cate_path = "{$cate_path}"
            var cate_source = $('#json_cate_list').val();
            cate_select_default(cate_source, cate_path)
        });
    </script>

</block>
